//package scala.hdfs
//
//import java.util.{Properties, UUID}
//import java.util.concurrent.TimeUnit
//
//import org.apache.flink.streaming.api.datastream.{BroadcastStream, DataStreamSource}
//import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
//import org.apache.flink.streaming.api.functions.source.{RichSourceFunction, SourceFunction}
//import org.apache.flink.api.scala._
// Flink10
//object test {
//  def main(args: Array[String]): Unit = {
//    import org.apache.flink.api.common.state.MapStateDescriptor
//    import org.apache.flink.api.common.typeinfo.BasicTypeInfo
//    // 构建流处理环境
//    val environment = StreamExecutionEnvironment.getExecutionEnvironment
//
//    // 配置处理环境的并发度为4
//    environment.setParallelism(2)
//
//
//    val CONFIG_KEYWORDS = new MapStateDescriptor[String, String]("config-keywords", BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.STRING_TYPE_INFO)
//
//    val value = environment.addSource(new RichSourceFunction[String]() {
//
//      var isRunning: Boolean = true
//      var str: String = " "
//      val properties: Properties = PropertiesUtils.getProperties("conf.properties")
//      //测试数据集
//      override def run(ctx: SourceFunction.SourceContext[String]): Unit = {
//        for (i <- 0 until 1000) {
//          str = PropertiesUtils.getValue(properties, "service")
//          //println(str)
//          ctx.collect(str)
//          //    - 每隔一秒执行一次循环
//          TimeUnit.SECONDS.sleep(1)
//        }
//      }
//
//      override def cancel(): Unit = {
//        //shutdown
//        isRunning = false
//      }
//    }).setParallelism(1)
//    // 自定义广播流（单例）
//    value.print()
//    environment.execute()
//  }
//}
